package com.abyss.source;
import org.apache.flink.api.java.ExecutionEnvironment;
import org.apache.flink.api.java.operators.DataSource;
/**
 * @author Abyss
 * @date 2020/10/4
 * @description 从HDFS中读取数据
 */
public class HDFSFileSourceDemo {
    public static void main(String[] args) throws Exception {
        // 1. env
        ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();

        // 2. HDFS source
        DataSource<String> hdfsFileSource = env.readTextFile("hdfs://node1:8000/test/people.txt");

        // 打印输出
        hdfsFileSource.print();
    }
}
